﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace project2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double a1 = Convert.ToDouble(textBox1.Text);
            double a2 = Convert.ToDouble(textBox2.Text);
            String type = comboBox1.SelectedItem.ToString();
            if (type == "+")
            {
                double result = a1 + a2;
                button1.Text = result.ToString();
            }
            else if (type == "-")
            {
                double result = a1 - a2;
                button1.Text = result.ToString();
            }
            else if (type == "*")
            {
                double result = a1 * a2;
                button1.Text = result.ToString();
            }
            else if(type == "/")
            {
                double result = a1 / a2;
                button1.Text = result.ToString();
            }
            else if(type == "%")
            {
                double result = a1 % a2;
                button1.Text = result.ToString();
            }
        }

        private void textBox1_TextChanged(object sender, EventArgs e){}
    }
}
